/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gray.swing.field;

import java.awt.Container;
import gray.Field;
import snippet.Snipet;
import javax.swing.JCheckBox;

/**
 *
 * @author martin
 */
public class CheckField extends JCheckBox implements Field<Boolean,Container>{
    //private final JCheckBox _box;
    
    private CheckField(final Snipet lang,final String name, final Character key){
        super(name);
        setMnemonic(key);

    }

    public static Field<Boolean,Container> factory(final Snipet lang,final String label, final Character key){
        return new CheckField(lang, label,key);
    }
    
    @Override
    public Boolean input() {
        return isSelected();
    }

    @Override
    public Container container() {
        return this;
    }
    
    @Override
    public Boolean ready() {
        return true;
    }
}
